#include "ObjLineImpGL.h"
#include <GL/freeglut.h>


ObjLineImpGL::ObjLineImpGL(Point3f p1, Point3f p2, u32 color, bool bShow)
	: ObjLine(bShow)
{
	m_x1 = p1.x;
	m_y1 = p1.y;
	m_z1 = p1.z;
	m_x2 = p2.x;
	m_y2 = p2.y;
	m_z2 = p2.z;
	m_origin.x = m_x1/2 + m_x2/2;
	m_origin.y = m_y1/2 + m_y2/2;
	m_origin.z = m_z1/2 + m_z2/2;
	m_alpha = (color >> 24) / 255.0f;
	m_red = ((color & 0x00ff0000) >> 16) / 255.0f;
	m_green = ((color & 0x0000ff00) >> 8)  / 255.0f;
	m_blue = (color & 0x000000ff) / 255.0f;
};


ObjLineImpGL::~ObjLineImpGL(void)
{
};


void ObjLineImpGL::Rotate(float angle, float axisX, float axisY, float axisZ)
{
}

void ObjLineImpGL::Scale(float scaleX, float scaleY, float scaleZ)
{
}

void ObjLineImpGL::Translate(float transX, float transY, float transZ)
{
}

void ObjLineImpGL::Update()
{
}

void ObjLineImpGL::Paint()
{
	if(m_bShow)
	{
		glColor4f(m_red, m_green, m_blue, m_alpha);
		glBegin(GL_LINES);
		glVertex3f(m_x1, m_y1, m_z1);
		glVertex3f(m_x2, m_y2, m_z2);
		glEnd();
	}
}
